<?php

namespace app\api\validate;

use app\common\validate\CommonValidate;

class UserValidate
{
    public static function authLogin($data)
    {
        $rule = [
            'code' => 'require',
        ];
        $message = [
            'code.require' => "参数错误",
        ];
        return CommonValidate::check($rule, $message, $data);
    }

    public static function accountLogin($data)
    {
        $rule = [
            'user_name' => 'require',
            'user_mobile' => 'require',
        ];
        $message = [
            'user_name.require' => "请填写姓名",
            'user_mobile.require' => "请填写手机号",
        ];
        return CommonValidate::check($rule, $message, $data);
    }

    public static function updateBaseInfo($data)
    {
        $rule = [
            'user_avatar' => 'require',
            'user_name' => 'require',
        ];
        $message = [
            'user_avatar.require' => "请选择或上传头像",
            'user_name.require' => "请输入昵称",
        ];
        return CommonValidate::check($rule, $message, $data);
    }
}